﻿@using Abp.Web.Mvc.Extensions
@using Microsoft.Owin.Security
@model KDS.Mes.Web.Models.Account.LoginFormViewModel
@section Styles
{
    @Html.IncludeStyle("~/Views/Account/Login.css")
}
@section Scripts
{
    @Html.IncludeScript("~/Views/Account/Login.js")
}


<p class="login-box-msg">@L("LogIn")</p>
<form id="LoginForm" action="@(Url.Action("Login", "Account"))?returnUrl=@(Model.ReturnUrl)" method="post">
    <fieldset>
        <div class="form-group has-feedback">
            <input type="text" class="form-control" id="EmailAddressInput" placeholder="@L("UserNameOrEmail")" required maxlength="@KDS.Mes.Users.User.MaxEmailAddressLength">
            <span class="glyphicon glyphicon glyphicon-user form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback">
            <input type="password" class="form-control" id="PasswordInput" placeholder="@L("Password")" required maxlength="@KDS.Mes.Users.User.MaxPlainPasswordLength">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>
        <div class="row">
            <div class="col-xs-8">
                <div class="checkbox icheck">
                    <label>
                        <input id="RememberMeInput" type="checkbox"> @L("RememberMe")
                    </label>
                </div>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <button id="LoginButton" type="submit" class="btn btn-primary btn-block btn-flat">@L("LogIn")</button>
            </div>
            <!-- /.col -->
        </div>
        <input id="ReturnUrlHash" type="hidden" name="returnUrlHash" />
    </fieldset>

</form>
@{
            var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes().ToList();
}
@if (loginProviders.Count > 0)
            {
    <p>@L("OrLoginWith"):</p>


    using (Html.BeginForm("ExternalLogin", "Account", method: FormMethod.Post))
    {
        @Html.AntiForgeryToken()

        <input type="hidden" name="returnUrl" value="@ViewBag.ReturnUrl" />
                <input type="hidden" name="provider" value="" />

        foreach (var provider in loginProviders)
        {
            <a class="btn btn-default btn-sm social-login-link" title="@provider.AuthenticationType"
               data-provider="@provider.AuthenticationType"
               href="javascript:;">
                <i class="fa fa-@(provider.AuthenticationType.ToLower())"></i> @provider.AuthenticationType
            </a>
        }
    }
}

